package com.atguigu.srb.oss.config;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.beanvalidation.SpringValidatorAdapter;

@Data
@Component
@ConfigurationProperties(prefix = "aliyun.oss")

public class OssProperties implements InitializingBean {
    private String endpoint;
    private String keyId;
    private String keySecret;
    private String endpointName;



    public static String ENDPOINT;
    public static String KEY_ID;
    public static String KEY_SECRET;
    public static String BUCKET_NAME;



    @Override
    public void afterPropertiesSet() throws Exception {
        ENDPOINT=this.endpoint;
        KEY_ID=this.keyId;
        KEY_SECRET=this.keySecret;
        BUCKET_NAME=this.endpointName;
    }
}
